<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">

        <el-col :span="8">
          <el-form-item label="设定单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="设定日期" prop="FBILLCREDATE">
            <el-date-picker v-model="dataForm.FBILLCREDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="设定状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择" disabled>
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="研学单号">
              <el-select v-model="dataForm.FSRCNO" placeholder="请选择" >
                <el-option
                  v-for="item in options9"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="学校名称" prop="FHOME">
            <el-input v-model="dataForm.FHOME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="课程名称" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="16">
          <el-form-item label="设定说明" prop="FMEMO">
            <el-input v-model="dataForm.FMEMO"   />
          </el-form-item>
        </el-col>
        
        <el-col :span="16">
          <el-form-item label="上传文件" prop="FFILENAME">
            <el-input v-model="dataForm.FFILENAME"   />
          </el-form-item>
        </el-col>

        <el-col :span="5">
          <el-form-item label="">
            <el-button type="success" icon="el-icon-plus" @click="insert">上传</el-button>
            <el-button type="primary" :loading="loading"  @click="cancel">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <template>


  </template>

    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        checked1: true,
        checked2  : true,
        activeName: 'second',
        url:require('@/assets/images/me/score.png'),

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLNO: "K241130005", 
            FSRCNO:"Y241130001",
            FHOME: "闵行春申小学",
            FCATNAME:"上海博物馆研学",
            FBILLCREDATE:"2024-11-29",
            FPOINT: "上海博物馆",
            FLCASS: "2-203展位",
            FUSER: "4-401展位",
            FTELNO: "四楼",
            FBEGDATE: "2024-12-01",
            FENDDATE:"2024-09-14",
            FENDTIME:"2028-06-31",
            FMEMO: "展位前后15米",
            FCHECKUSE: "",
            FCHECKDATE: "",
            FNOTE:"",
            FBILLTYPE:"本部人员",
            FBILLSTATE: "申请中"
        },
        rules: {
          FUSER:[
            { required: true, message: '请输入学生姓名', trigger: 'blur' },
          ],
          FTELNO: [
            { required: true, message: '请输入学籍号', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入备注', trigger: 'blur' },
          ],
        },
        list2: [{  "FENTRYID":1,
                  "FEQUIPNO": "98001",
                  "FEQUIPNAME": "奉3教楼101教室"
                },
                { "FENTRYID":2,
                  "FEQUIPNO": "98002",
                  "FEQUIPNAME": "奉3教楼102教室"
                }],
        list1: [{  "FENTRYID":1,
                    "FWORKNO": "1-1",
                    "FWORKNAME": "秦始皇",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FWORKNO": "1-2",
                    "FWORKNAME": "汉武帝",
                    "FMEMO": ""
                  }],
        
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '未确认'
        }, {
          value: '2',
          label: '已确认'
        }, {
          value: '3',
          label: '已作废'
        }],

        options2: [{
          value: '1',
          label: '本部人员'
        }, {
          value: '2',
          label: '访客卡'
        }, {
          value: '3',
          label: '管理卡'
        }],

        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      //
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>